package com.demo.entity;

public class ResponseResult<T>  {

	Integer code; //状态码
	String msg; //信息
	Long count;
	T data; //数据

	public static ResponseResult getResponseResult(Integer result){
		ResponseResult responseResult = null;
		responseResult = (result==1)?new ResponseResult(0,"操作成功"):new ResponseResult(-1,"操作失败");
		return responseResult;
	}
	
	public ResponseResult() {
	}
	
	public ResponseResult(Integer code, String msg) {
		//super();
		this.code = code;
		this.msg = msg;
	}
	
	public ResponseResult(Long count, T data) {
		this.count = count;
		this.data = data;
	}
	
	public ResponseResult(Integer code, String msg, Long count, T data) {
		//super();
		this.code = code;
		this.msg = msg;
		this.count = count;
		this.data = data;
	}
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Long getCount() {
		return count;
	}
	public void setCount(Long count) {
		this.count = count;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
}
